package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.CouponUseRecord;
import com.micro.modual.model.bo.couponuserecord.CouponUseRecordBO;

/**
 * <h1>优惠券使用记录表 延展类</h1>
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class CouponUseRecordExtension {

    /**
     * <h2>转换: 优惠券使用记录表 新增</h2>
     * @param couponUseRecordBO {@link CouponUseRecordBO} 优惠券使用记录表 新增/修改 请求对象
     * @return {@link CouponUseRecord} 优惠券使用记录表
     */
    public static CouponUseRecord converAddCouponUseRecord(CouponUseRecordBO couponUseRecordBO) {
        CouponUseRecord couponUseRecord = new CouponUseRecord();
        couponUseRecord.setId(SnowFlakeUtil.getId());
                                                            couponUseRecord.setCouponCode(couponUseRecordBO.getCouponCode());
                                                    couponUseRecord.setUseTime(couponUseRecordBO.getUseTime());
                                                    couponUseRecord.setOrderCode(couponUseRecordBO.getOrderCode());
                                                    couponUseRecord.setUserCode(couponUseRecordBO.getUserCode());
                                                    couponUseRecord.setTemplateCategory(couponUseRecordBO.getTemplateCategory());
                                                    couponUseRecord.setDeductionPrice(couponUseRecordBO.getDeductionPrice());
                            return couponUseRecord;
    }

    /**
     * <h2>转换: 优惠券使用记录表 修改</h2>
     * @param couponUseRecordBO {@link CouponUseRecordBO} 优惠券使用记录表 新增/修改 请求对象
     * @return {@link CouponUseRecord} 优惠券使用记录表
     */
    public static CouponUseRecord converEditCouponUseRecord(CouponUseRecordBO couponUseRecordBO) {
        CouponUseRecord couponUseRecord = new CouponUseRecord();
        couponUseRecord.setId(couponUseRecordBO.getId());
                                                        couponUseRecord.setCouponCode(couponUseRecordBO.getCouponCode());
                                                couponUseRecord.setUseTime(couponUseRecordBO.getUseTime());
                                                couponUseRecord.setOrderCode(couponUseRecordBO.getOrderCode());
                                                couponUseRecord.setUserCode(couponUseRecordBO.getUserCode());
                                                couponUseRecord.setTemplateCategory(couponUseRecordBO.getTemplateCategory());
                                                couponUseRecord.setDeductionPrice(couponUseRecordBO.getDeductionPrice());
                            return couponUseRecord;
    }
}
